package com.wanxi.duotai;

public class Animal {
    public Integer height = 2;
    private String name;
    private Integer age;

    public Animal() {
    }

    public Animal(String name) {
        this.name = name;
    }

    public void sleep() {
        System.out.println("Animal在睡觉");
    }

    //    public void sleep(Cat cat) {
//        System.out.println(cat.getName() + "Animal在睡觉");
//    }
//    public void sleep(Dog dog) {
//        System.out.println(dog.getName() + "Animal在睡觉");
//    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }
}
